package com.ets.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import com.ets.service.*;

@Controller
@RequestMapping("manage")
public class DeleteController {
	@Resource
	private StuResultService srService;
	@Resource
	private LessonService lService;
	@Resource
	private PaperService pService;
	@Resource
	private QuestionService qService;
	//Delete student result.
	@RequestMapping("deleteResult")
	public String deleteResult(@RequestParam("id") int id){
		srService.deleteResult(id);
		return "redirect:stuResult.do";
	}
	
	//Delete lesson.
	@RequestMapping("deleteLesson")
	public String deleteLesson(@RequestParam("id") int id){
		lService.deleteLesson(id);
		return "redirect:lesson.do";
	}
	
	//Delete paper.
	@RequestMapping("deletePaper")
	public String deletePaper(@RequestParam("id") int id){
		pService.deletePaper(id);
		return "redirect:paper.do";
	}
	
	//Delete paper.
	@RequestMapping("deleteQuestion")
	public String deleteQuestion(@RequestParam("id") int id){
		qService.deteleQuestion(id);
		return "redirect:question.do";
	}
}
